const router = require("koa-router")();
const loginControler = require("../controller/login")

// router.prefix("/")
// 登录获取表单数据，判断用户名和密码是否存在并正确，正确生成token返回给前端
router.post("/login", loginControler.login)

router.get("/logout", loginControler.logout)

router.post("/register", loginControler.register)

router.post("/getMenu", loginControler.getMenu)

router.get("/login/test", (ctx, next) => {
    ctx.body = {
        status: 200,
        data: "测试数据"
    }
})

module.exports = router